/*
============================================================================
 Name        : ShoutcastUI.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CShoutcastUI declaration
============================================================================
*/

#ifndef __SHOUTCASTUI_H__
#define __SHOUTCASTUI_H__

// INCLUDES
#include <e32std.h>
#include <e32base.h>

#include "MPluginContainer.h"

class CWindowGc;
class CFbsBitmap;
class CTicker;

// CLASS DECLARATION
class CShoutcastUI : public CBase
{
public: // Constructors and destructor
	~CShoutcastUI();
	static CShoutcastUI* NewL();
	static CShoutcastUI* NewLC();

private:
	CShoutcastUI();
	void ConstructL();

public:
	enum TShoutcastTickerIcon
	{
		EPlay,
		EStop,
		EBuffering,
		EError,
		ENull
	};

public: //new functions
	void Draw(CWindowGc& aGc, const TRect& aRect) const;
	
	void SetTickerIcon(TShoutcastTickerIcon aIcon);
	void SetTickerText(const TDesC& aText);
	void SetTickerTextFormat(TRefByValue<const TDesC16> aFmt, ...);

	void SetContainer(MPluginContainer* aContainer);
	void SetTitle(const TDesC& aTitle);

	void SetIsBuffering(TBool aIsBuffering, TInt aPercent);

	void Activate();
	void Deactivate();

	//Colors
	TRgb BackBorderColor() const { return TRgb(0x084200); }
	TRgb BackShadowColor() const { return TRgb(0x42944a); }
	TRgb BackColor() const { return TRgb(0x52b55a); }
	TRgb InsideBorderColor() const { return TRgb(0x086b00); }
	TRgb InsideColor() const { return TRgb(0xb5efbd); }
	TRgb ForeColor() const { return InsideBorderColor(); }


private: //data
	//Reference to container
	MPluginContainer* iContainer;

	//Bitmaps
	RPointerArray<CFbsBitmap> iBitmaps;

	//Ticker
	CTicker* iTitle;

	//Check if is buffering
	TBool iIsBuffering;
	TBool iPercent;

	//Metadata
	TBuf<500> iMetadata;

	//Font dimensions
	TInt iFontHeight;
	TInt iTextWidth;
};

#endif // __SHOUTCASTUI_H__
